<?php
/*
 * 车主金卡认证
 * @arrange WL
 * @package ixdcw
 * @file    checkcard.inc.php
 * @time    13-10-23 上午9:00
 */
defined('IN_IXDCW') or exit('Access Denied');
login();
require DT_CORE.'/'.$module.'/common.inc.php';

$userdata=userinfo($_username);
if(empty($userdata['truename']) || !isset($userdata['truename']))Prompt::message('请先完善个人资料',url('member/edit').'?tab=1');


$checkcardDb = Db('owncard');
$checkcarAction = new OwnCardModule();
$user = array();
$userinfo = $checkcardDb->getByUsername($_username);
extract($userinfo);
//判断车主会员是否存在
if(!$userinfo){
	$user['username'] = $_username;
	$user['checktime'] = $DT_TIME;
	$user['checknum'] = 3;
	$checkcardDb->addUsername($user);
	$userinfo = $checkcardDb->getByUsername($_username);
	extract($userinfo);
}
if(!$status){
	//判断认证日期是否当前日期
	if(date('Ymd',$checktime) !== date('Ymd',$DT_TIME)){
		$user['username'] = $_username;
		$user['checktime'] = $DT_TIME;
		$user['checknum'] = 3;
		$checkcardDb->updateUsername($user);
		$userinfo = $checkcardDb->getByUsername($_username);
		extract($userinfo);
	}
}

include template('checkcard', 'member');
?>